﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Aga.Psad.Common;
using Aga.Psad.Mvc.Helpers;

namespace Aga.Psad.Mvc.Models.TipoDocumento
{
    public class TipoDocumentoViewModel
    {
        public TipoDocumentoViewModel()
        { }

        public int Id { get; set; }
        public string Nombre { get; set; }

        public bool IsValid
        {
            get { return (GetRuleViolations().Count() == 0); }
        }

        public IEnumerable<RuleViolation> GetRuleViolations()
        {
            if (String.IsNullOrEmpty(Nombre))
                yield return new RuleViolation("Ingrese un Nombre", "Nombre");

            yield break;
        }

    }
}
